package com.book.helper;

import com.book.dto.BrowseHistoryDto;
import com.book.pojo.BrowseHistory;
import org.springframework.beans.BeanUtils;

/**
 * @version 1.0
 * @Author Jincheng.Li
 * @Date 2021/5/29 9:13 下午
 * @Project_Name graduation-project
 */
public class BrowseHistoryHelper {

    public static BrowseHistoryDto covertPoToDto(BrowseHistory browseHistory){
        if (browseHistory == null){
            return null;
        }
        BrowseHistoryDto browseHistoryDto = new BrowseHistoryDto();
        BeanUtils.copyProperties(browseHistory,browseHistoryDto);
        return browseHistoryDto;
    }

    public static BrowseHistory covertDtoToPo(BrowseHistoryDto browseHistoryDto){
        if (browseHistoryDto == null){
            return null;
        }
        BrowseHistory browseHistory = new BrowseHistory();
        BeanUtils.copyProperties(browseHistoryDto,browseHistory);
        return browseHistory;
    }
}
